package com.whyt.oauth.auth.conf;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 用来配置自己的登录页面资源属性
 *
 * @author ASUS
 */
@SuppressWarnings("all")
@Configuration
public class WebMvcConfig implements WebMvcConfigurer
{
    /**
     * 静态资源路径指定
     *
     * @param registry
     */
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/static/**")
//                .addResourceLocations("/static/")
//                .resourceChain(false);
//        registry.setOrder(1);
//    }

    /**
     * 配置路径、视图
     *
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry)
    {
        registry.addViewController("/login").setViewName("login");
        registry.addViewController("/register").setViewName("register");
        registry.addViewController("/change-password").setViewName("changePassword");
    }
}

